package com.example.tuomin.config;

import gov.jyy.xzxk.xksq.common.desensitization.interceptor.ThreadLocalCleanupInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @className: WebMvcConfig
 * @description: TODO 类描述
 * @author: liangshijie
 * @date: 2023/4/26
 **/
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Bean
    public ThreadLocalCleanupInterceptor threadLocalCleanupInterceptor() {
        return new ThreadLocalCleanupInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(threadLocalCleanupInterceptor());
    }
}
